package com.lehuowujie.lehuomarket.ui.login;

import android.app.Activity;

import com.lehuowujie.lehuomarket.R;
import com.lehuowujie.lehuomarket.util.NetUtils;

/**
 * Created by 王瑞铭 on 2017/1/13.
 */
public class ILoginModelImpl implements ILoginModel {

    @Override
    public void login(Activity activity, OnLoginListener listener) {
        //请求网络
        if (!NetUtils.getNetUtilsIntance().isConnected(activity)) {
            listener.onError(activity.getString(R.string.no_network));
            return;
        }
        //请求接口
        listener.onSuccess();
    }

    public interface OnLoginListener {
        void onError(String errorMessage);

        void onSuccess();
    }

}
